package com.lanou.myim.presenter;

import com.lanou.myim.model.MainModel;
import com.lanou.myim.model.MainModelInterface;
import com.lanou.myim.ui.activity.MainActivityInterface;

/**
 * Created by dllo on 16/3/5.
 */
public class MainPresenter implements MainPresenterInterface{
    private MainModelInterface mainModelInterface;
    private MainActivityInterface mainActivityInterface;

    public MainPresenter(MainActivityInterface mainActivityInterface){
        this.mainActivityInterface = mainActivityInterface;
        mainModelInterface = new MainModel();
    }

    @Override
    public void remindUnreadMsg() {
        int count = mainModelInterface.getAllUnreadMsgCount();
        if (count>0){
            mainActivityInterface.showCount(count);
        }else {
            mainActivityInterface.dismissCount();
        }
    }
}
